<template>
	<view class="content">
		<view v-for="(item, index) in dataList" :key="index">
			<uni-card :title="item.auditorName" :sub-title="item.completeTime" :extra="item.taskName" thumbnail="/static/images/icon/sp-icon.png">
				<text>{{item.opinion}}</text>
			</uni-card>
		</view>
	</view>
</template>

<script>
	import { getFlowHistory } from '@/api/base/flow.js'
	
	export default {
		data() {
			return {
				bizKey: "",
				defKey: "",
				dataList: []
			}
		},
		onLoad(option) {
			this.bizKey = option.bizKey
			this.defKey = option.defKey
			
			this.loadData()
		},
		methods: {
			loadData() {
				const params = {
					bizKey: this.bizKey,
					defKey: this.defKey
				}
				getFlowHistory(params).then(res=>{
					res.data.forEach(item=>{
						if(item.completeTime) {
							this.dataList.push(item)
						}
					})
				})
			}
		}
	}
</script>

<style>
	.content {
		padding-bottom: 1px;
	}
</style>
